﻿@using Icoders.MarketTracker.Web.Lib.Util.Helper
<!DOCTYPE html>
<html>
<head>
    <title>@ViewBag.Title</title>
    <script type="text/javascript" src="https://www.google.com/jsapi"></script>
    <link href="@Url.Content("~/Content/Site.css")" rel="stylesheet" type="text/css" />
    <script src="@Url.Content("~/Scripts/jquery-1.4.4.min.js")" type="text/javascript"></script>
    <link href="@Url.Content("~/Content/themes/base/jquery-ui.css")" rel="stylesheet" type="text/css" media="screen"/>
    <script src="@Url.Content("~/Scripts/jquery-ui.min.js")" type="text/javascript"></script>
    <script type="text/javascript">
        $(function () {
            $("#accordion").accordion({
                active: 'h2.menu@(Html.Area())'
            });
        });
       
    </script>
    <script type="text/javascript" language="javascript">
        function changeLang() {
            var lang = $("#ClientId").val();
            $.getJSON('@Url.Content("~/Home/ChangeClient")', { client: lang }, function (data) {
               
            })
        }
</script>

</head>
<body>
    <table border="0" cellpadding ="0" cellspacing ="0" width="100%">
        <tr>
            <td valign="top" colspan="2" class="topbar">
                <img src="@Url.Content("~/Content/themes/base/images/Logo.jpg")"  height="60px"/>
                <div style="float:right;">
                    @{
                        var selecteditem = "";
                         var cookie = Request.Cookies["SelectedClient"];
                         if(cookie!=null)
                         {
                             selecteditem = cookie.Value;
                         }
                    }
                    @Html.DropDownList("ClientId", new SelectList(Html.GetClient(), "value", "text", @selecteditem),"All", new { onchange = "changeLang(this)" })
                </div>
            </td>            
        </tr>
        <tr>
        <td valign="top" colspan="2" class="topmenubar">
            <div style="float:right;">
                @Html.ActionLink("Logout", "Logout", "Account", new {area=""},null)
            </div>
            
            </td>
        </tr>
        <tr>
            <td valign="top" class="leftmenu">
                <div id="accordion">
                    <h2 class='menuHome'>
                        <a href="#">Home</a></h2>
                    <ul class="menulist">
                        @Html.MenuItem("Main Dashboard", "Index", "Home","","selected")
                        @if (Html.IsKimfay())
                        {
                            @Html.MenuItem(" Penetration and Availability", "Index", "DashBoard", "", "selected")
                            @Html.MenuItem("Sales Value DashBoard", "SalesValue", "DashBoard", "", "selected")
                            @Html.MenuItem("Sales Volume DashBoard", "SalesVolume", "DashBoard", "", "selected")
                        }
                         @if (Html.IsBAT())
                        {
                            @Html.MenuItem("BAT Dashboard", "Index", "BAT", "", "selected")
                            @Html.MenuItem("Sale by SKU Dashboard", "SalebyProduct", "BAT", "", "selected")
                             @Html.MenuItem("Call Efficiency Dashboard", "CallEfficiency", "BAT", "", "selected")
                              @Html.MenuItem("Call Effectiveness Dashboard", "CallEffectiveness", "BAT", "", "selected")
                        }
                        
                    </ul>
                    @if (User.IsInRole("ROLE_ADMIN"))
                    {
                    <h2 class='menuAdmin'>
                        <a href="#">Administration</a></h2>
                    <ul class="menulist">

                        @Html.MenuItem("Country", "index", "Country", "Admin", "selected")
                        @Html.MenuItem("City", "index", "City", "Admin", "selected")
                        @Html.MenuItem("Area", "index", "Area", "Admin", "selected")
                        @Html.MenuItem("Zone", "index", "Zone", "Admin", "selected")
                        @Html.MenuItem("Client", "index", "Client", "Admin", "selected")
                         @Html.MenuItem("Product Brand", "Index", "ProductBrand", "Admin", "selected")
                        @Html.MenuItem("Product", "Index", "Product", "Admin", "selected")
                        @Html.MenuItem("Point of Sale", "index", "PointOfSale", "Admin", "selected")
                        @Html.MenuItem("Point of Purchase", "index", "PointOfPurchase", "Admin", "selected")
                        @Html.MenuItem("Point of Purchase Type", "index", "PointOfPurchaseType", "Admin", "selected")
                        @Html.MenuItem("Reason", "Index", "Reason", "Admin", "selected")
                        @Html.MenuItem("News", "index", "News", "Admin", "selected")
                    </ul>
                    }
                    @if (User.IsInRole("ROLE_FSRADMIN"))
                    {
                    <h2 class='menuAdminFRS'>
                        <a href="#">FSR Admin</a></h2>
                        <ul class="menulist">
                        @Html.MenuItem("FSR Manage", "Index", "FrsAssign", "AdminFRS", "selected")
                        </ul>
                    }
                    <h2 class='menuReports'>
                        <a href="#">Report</a></h2>
                    <ul class="menulist">
                        @if (User.IsInRole("ROLE_ADMIN") && User.IsInRole("ROLE_REPORT"))
                        {
                        @Html.MenuItem("BTL DashBoard", "BtlDashBoard", "Report", "Reports", "selected")
                        }
                        @if (User.IsInRole("ROLE_CLIENT") && User.IsInRole("ROLE_REPORT"))
                        {
                        @Html.MenuItem("Detail Reports ", "ClientDashBoard", "Report", "Reports", "selected")
                        }
                       
                    </ul>
                     @if (User.IsInRole("ROLE_SMSADMIN"))
                     {
                     <h2 class='menuSmsAdmin'>
                        <a href="#">Sms Admin</a></h2>
                    <ul class="menulist">
                        @Html.MenuItem("Manage Users", "Index", "User", "SmsAdmin", "selected")
                        @Html.MenuItem("Reset Users", "Index", "Reset", "SmsAdmin", "selected")
                         @Html.MenuItem("User Group", "Index", "Group", "SmsAdmin", "selected")     
                    </ul>
                     }
                </div>
            </td>
            <td valign="top" class="content">
             @RenderBody()
            </td>
        </tr>
    </table>
   
</body>
</html>
